#include "system.h"



/* export func */


/**
 * @brief 使能全局中断
 * 
 */
void system_int_enable(void)
{
    __set_PRIMASK(0);
}

/**
 * @brief 禁止全局中断
 * 
 */
void system_int_disable(void)
{
    __set_PRIMASK(1);
}

/**
 * @brief 系统软复位
 * 
 */
void system_soft_reset(void)
{
    SCB->AIRCR = 0X05FA0000 | (uint32_t)0x04;
}

#define SYSTEM_UNIQUE_DEVICE_ID_BASE *(volatile uint32_t*)(0x1FF1E800)

void system_get_mcu_sn(uint32_t *sn0, uint32_t *sn1, uint32_t *sn2)
{
    *sn0 = SYSTEM_UNIQUE_DEVICE_ID_BASE;
    *sn1 = (SYSTEM_UNIQUE_DEVICE_ID_BASE + 4);
    *sn2 = (SYSTEM_UNIQUE_DEVICE_ID_BASE + 8);

}
